package com.hengli.mapper;

import com.hengli.entity.WineSpecification;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ljx
 * @date 2024/3/24 15:47
 */
@Mapper
public interface WineSpecificationMapper {

    /**
     * 批量插入规格数据
     * @param specifications
     */
    void insertBatch(List<WineSpecification> specifications);


    /**
     * 根据酒品id删除对应的规格数据
     * @param wineId
     */
    @Delete("delete from wine_specification where wine_id = #{wineId}")
    void deleteByWineId(Long wineId);

    /**
     * 根据酒品id查询对应的规格数据
     * @param
     * @return
     */
    @Select("select * from wine_specification where wine_id = #{wineId}")
    List<WineSpecification> getByWineId(Long wineId);
}
